/*
 * @Author: 江舟 jijiangzhou@recycloud.cn
 * @Date: 2024-07-04 09:41:32
 * @LastEditors: 江舟 jijiangzhou@recycloud.cn
 * @LastEditTime: 2024-08-09 10:21:30
 * @FilePath: \vite-project\src\apis\message\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import http from 'utils/http';

/**
 * 统计未读消息
 * @returns
 */
export const countWaitReadInbox = (data: any) => {
    return http<
        typeof data,
        {
            waitReadCount?: number;
        }
    >({
        url: '/api/inbox/countWaitReadInbox',
        method: 'post',
        data,
    });
};

/**
 * 分页查询站内信
 * @param data
 * @returns
 */
export const pageInboxs = (data: any) => {
    return http<
        typeof data,
        {
            recordDatas: {
                title?: string;
                createTimeStr?: string;
            }[];
        }
    >({
        url: '/api/inbox/pageInboxs',
        method: 'post',
        data,
    });
};

/**
 * 分页查询站内信
 * @param data
 * @returns
 */
export const queryInboxDetail = (data: any) => {
    return http({
        url: '/api/inbox/queryInboxDetail',
        method: 'post',
        data,
    });
};

/**
 * 标记站内信为已读
 * @param data
 * @returns
 */
export const markInboxAsRead = (data: any) => {
    return http({
        url: '/api/inbox/markInboxAsRead',
        method: 'post',
        data,
    });
};

/**
 * 标记所有站内信为已读
 * @param data
 * @returns
 */
export const markAllInboxAsRead = (data: any) => {
    return http({
        url: '/api/inbox/markAllInboxAsRead',
        method: 'post',
        data,
    });
};
